cmake_minimum_required(VERSION 3.8)
project(armor_detector)

# 找到依赖包
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(OpenCV REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(TBB REQUIRED)
find_package(fmt REQUIRED)  # 找到 fmt 库
# 包含头文件
include_directories(
  include
  ${OpenCV_INCLUDE_DIRS}
  ${EIGEN3_INCLUDE_DIR}
)

# 添加源文件
set(SOURCES
  src/armor_detector.cpp
  src/main.cpp
)

# 创建可执行文件
add_executable(armor_detector_node ${SOURCES})

# 注册组件依赖项
ament_target_dependencies(armor_detector_node
  rclcpp
  sensor_msgs
  cv_bridge
  OpenCV
  Eigen3
  fmt  # 添加 fmt 依赖
)

# 链接库
target_link_libraries(armor_detector_node
  ${OpenCV_LIBRARIES}
  Eigen3::Eigen
  TBB::tbb
)

# 安装
install(TARGETS armor_detector_node
  DESTINATION lib/${PROJECT_NAME}
)

ament_package()

